//---------------------------------------------------------------------------


#pragma hdrstop

#include "TDataBase.h"

//---------------------------------------------------------------------------
TDataBase::TDataBase( int *err,
					  char *FileName,
					  char *Reg,
					  char *PassWord,
					  char *BaseName )
{
   hDll01 = Base01LoadFun();


	base=_BaseOpen( err, FileName, Reg, PassWord, BaseName );
};

TDataBase::~TDataBase()
{
	if(NULL != base )
	{
		_BaseClose(base);
	}
};
int TDataBase::BaseInitObject ( GBASE_OBJECT *Object,
							 BASE_INT *pSem,
							 long mSem,
							 void*pSv,
							 long mSv,
							 void*Pr,
							 long mPr,
							 void*Sq,
							 long mSq,
							 void*Met,
							 long mMet,
							 char *Text,
							 long mText,
							 VIDEO_HEADER *Video,
							 long mVideo )
{
	return _BaseInitObject( Object, pSem, mSem, pSv, mSv, Pr, mPr, Sq, mSq, Met, mMet,
                            Text, mText, Video, mVideo);
};
void TDataBase::BaseInitQuery( GBASE_QUERY *Query,
							   long Key,
							   int Ident )
{
	_BaseInitQuery(Query,Key, Ident);
};
int TDataBase::BaseReadObject( GBASE_QUERY *Query,
							   BASE_INT *Select,
							   int Fun,
							   int Read,
							   GBASE_OBJECT *Object,
							   BASE_INT *Code,
							   unsigned long Number )
{
	return _BaseReadObject( base,Query,Select,Fun, Read,
					Object,Code,Number );
};
int TDataBase::BaseCloseobject( GBASE_OBJECT *Object )
{
    _BaseCloseObject(Object);
}
#pragma package(smart_init)
